home *** CD-ROM | disk | FTP | other *** search
/ Revista do CD-ROM 101 / CD-ROM 101.iso / compl / maya5ple / Install_MayaPLE5_English.exe / Maya / Data1.cab / artFluidAttrValues.mel < prev    next >
Encoding:
Text File  |  2003-07-17  |  5.1 KB  |  161 lines

  1. // Copyright (C) 1997-2002 Alias|Wavefront,
  2. // a division of Silicon Graphics Limited.
  3. //
  4. // The information in this file is provided for the exclusive use of the
  5. // licensees of Alias|Wavefront.  Such users have the right to use, modify,
  6. // and incorporate this code into other products for purposes authorized
  7. // by the Alias|Wavefront license agreement, without fee.
  8. //
  9. // ALIAS|WAVEFRONT DISCLAIMS ALL WARRANTIES WITH REGARD TO THIS SOFTWARE,
  10. // INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS, IN NO
  11. // EVENT SHALL ALIAS|WAVEFRONT BE LIABLE FOR ANY SPECIAL, INDIRECT OR
  12. // CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM LOSS OF USE,
  13. // DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR OTHER
  14. // TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR
  15. // PERFORMANCE OF THIS SOFTWARE.
  16. //
  17. //
  18. //  Alias|Wavefront Script File
  19. //  MODIFY THIS AT YOUR OWN RISK
  20. //
  21. //  Creation Date:  June 2000
  22. //  Author:         alipka 
  23. //
  24. //  Description:
  25. //      Option tool property window for Artisan tools
  26. //
  27. //
  28. //  Procedure Name:
  29. //      artSelectValues
  30. //
  31. //  Description:
  32. //      Initialize the option values.
  33. //
  34. //  Input Arguments:
  35. //
  36. //  Return Value:
  37. //      None.
  38. //
  39.  
  40. proc artFluidAttrAttributeValues( string $artCommand, string $currTool ) 
  41. {
  42.     string  $autoSaveCmd = eval( $artCommand + " -q -as `currentCtx` " );
  43.     checkBoxGrp -e -v1 ($autoSaveCmd != "artFluidAttrConfirmPaintLoss") 
  44.         artFluidAutoSave;
  45.  
  46.     int     $allowImportExport = true;
  47.     string     $attr = eval( $artCommand + " -q -p `currentCtx` " );
  48.  
  49.     if( $attr == "color" ) {
  50.         $attr = "Color";
  51.     } else if( $attr == "temperature" ) {
  52.         $attr = "Temperature";
  53.     } else if( $attr == "fuel" ) {
  54.         $attr = "Fuel";
  55.     } else if( $attr == "velocity" ) {
  56.         $attr = "Velocity";
  57.     } else if( $attr == "densityAndColor" ) {
  58.         $attr = "Density and Color";
  59.     } else if( $attr == "densityAndFuel" ) {
  60.         $attr = "Density and Fuel";
  61.     } else {
  62.         $attr = "Density";
  63.     }
  64.  
  65.     string $oper = eval( $artCommand + " -q -selectedattroper `currentCtx`" );
  66.     int $smooth = ( $oper == "smooth" );
  67.     int $scale =  ( $oper == "scale" );
  68.  
  69.     int $dispAsRender = eval( $artCommand + " -q -dar `currentCtx` " );
  70.     radioButtonGrp -e -sl ($dispAsRender+1) artFluidDisplayAsRender;
  71.  
  72.     int $dispVelocity = eval( $artCommand + " -q -dv `currentCtx` " );
  73.     checkBoxGrp -e -v1 $dispVelocity artFluidDisplayVelocity;
  74.  
  75.     optionMenuGrp -e -v $attr artAttrListOptionMenu;
  76.  
  77.     float $color[3] = eval( $artCommand + " -q -rgb `currentCtx` " );
  78.     colorSliderGrp -e 
  79.         -en ( !$smooth && (($attr == "Color") || ($attr == "Density and Color")) )
  80.         -rgb $color[0] $color[1] $color[2] artFluidColorSlider;
  81.     
  82.     int $useIt = eval( $artCommand + " -q -usd `currentCtx` " );
  83.     int $select = $useIt == 1 ? 1 : 2;
  84.     radioButtonGrp -e 
  85.         -en (!$smooth && !$scale && ($attr == "Velocity"))
  86.         -select $select artFluidStrokeDirection;
  87.  
  88.     float $velocity[] = eval( $artCommand + " -q -v `currentCtx` " );
  89.     floatFieldGrp -e 
  90.         -en ( !$smooth && !$scale && ($attr == "Velocity") && ($select == 2))
  91.         -v1 $velocity[0]
  92.         -v2 $velocity[1]
  93.         -v3 $velocity[2]
  94.         artFluidSpecifiedVelocity;
  95.     
  96.  
  97.     // Disable the Value slider for Color painting
  98.     //
  99.     floatSliderGrp -e -en (!$smooth && ($attr != "Color")) artAttrValueSlider;
  100.     floatFieldGrp -e -en ($attr != "Color") artAttrMinMaxValue;
  101.     checkBoxGrp -e -en ($attr != "Color") artAttrClampChkBox;
  102.     floatFieldGrp -e -en ($attr != "Color") artAttrClampField;
  103.  
  104.     // Cannot export/import Velocity or Color+Density.
  105.     //
  106.     button -e -en $allowImportExport importMapBrowseButton;
  107.     button -e -en $allowImportExport exportMapBrowseButton;
  108.  
  109.     // Update the drawing parameters on the geometry to reflect
  110.     // the menu selection.
  111.     //
  112.     //    artFluidAttrPaintMenu $artCommand;
  113. }
  114.  
  115. // =======================================================
  116. // Main callback procedure for Paint Selecion tool.
  117. // =======================================================
  118. global proc artFluidAttrValues( string $toolName ) {
  119.     source "artisanCallback.mel";
  120.     source "artisanValues.mel";
  121.  
  122.     source "artAttrValues.mel";
  123.  
  124.     string       $parent = (`toolPropertyWindow -q -location` + "|artFluidAttr");
  125.     setParent $parent;
  126.  
  127.     string $artCommand = "artFluidAttrCtx";
  128.  
  129.     string $currContext = `currentCtx`;
  130.     string $currTool    = `contextInfo -c $currContext`;
  131.  
  132.     // Provide a different icon for different attribute tools.
  133.     string $icon      = "fluidPaint.xpm";
  134.     string $helpTag      = "PaintFluidsTool";
  135.  
  136.     toolPropertySetCommon $toolName $icon $helpTag;
  137.  
  138.     // Brush frameLayout values.
  139.     artisanBrushValues( $artCommand, $currTool );
  140.  
  141.     // Paint Attribute frameLayout values.
  142.     artFluidAttrAttributeValues( $artCommand, $currTool );
  143.  
  144.     // Paint Attribute frameLayout values.
  145.     artAttrPaintValues( $artCommand, $currTool );
  146.  
  147.     // Stroke frameLayout values.
  148.     artisanStrokeValues( $artCommand, $currTool );
  149.  
  150.     // Stylus Pressure frameLayout values.
  151.     artisanPressureValues( $artCommand, $currTool );
  152.  
  153.     // Attribute Maps frameLayout values.
  154.     artisanAttrMapValues( $artCommand, $currTool );
  155.  
  156.     // Display frameLayout values.
  157.     artisanDisplayValues( $artCommand, $currTool );
  158.  
  159.     toolPropertySelect artFluidAttr;
  160. }
  161.